package com.etc.service.impl;

import com.etc.dao.DepartmentMapper;
import com.etc.dao.DoctorMapper;
import com.etc.entity.Department;
import com.etc.entity.Doctor;
import com.etc.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Autowired
    private DoctorMapper doctorMapper;

    private Department department =null;
    @Override
    public List<Department> findAllDepartment() {
        return departmentMapper.findSelective(department);
    }

    @Override
    public List<Doctor> findAllDoctorByDeptId(Integer deptId) {
        return doctorMapper.findDoctorByDeptId(deptId);
    }
}
